const phoneRegx = /^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[0-9]))\d{8}$/
const emialRegx = /^\w+@\w+\.\w+[.\w]?$/
const workPhoneNumberRegex = /^[\d-+]{8,14}$/
const verificationCodeRegx = /\d{6}/
const IDCardRegex = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/
const BanckCardNoRegex = /^\d{9,48}$/
const TurnoverRegex = /^\d{0,12}$/
const machineNoRegex = /^TT[\w]{10,13}$/
const HttpLinkReg = /^https?:\/\/[a-zA-Z\d]{2,}\.[a-zA-Z\d.]+$/i
const ComponentFieldReg = /^[a-zA-Z/]{2,}/i
export const WeChatEnvRegx = /MicroMessenger/i
export const base64Regex = /:(\S+);\w+,(.*)$/i
export const timeRegex = /(\d{4}).(\d{2}).(\d{2})/g
export const phoneNumber = (value:string) => phoneRegx.test(value)
export const verificationCode = (value:string) => verificationCodeRegx.test(value)
export const workPhoneNumber = (value:string) => workPhoneNumberRegex.test(value)
export const email = (value:string) => emialRegx.test(value)
export const IDCard = (value:string) => IDCardRegex.test(value)
export const BanckCardNo = (value:string) => BanckCardNoRegex.test(value)
export const Turnover = (value:string) => TurnoverRegex.test(value)
export const machineNo = (v:string) => machineNoRegex.test(v)
export const LinkStr = (v:string) => HttpLinkReg.test(v)
export const ComponentField = (v:string) => ComponentFieldReg.test(v)

